﻿using SqlSugar;
using System;
using System.Collections.Generic;

namespace Raffles.OA.Data
{
    /// <summary>
    /// 日 期：2024-07-16 14:04:51
    /// 描 述：渠道管理实体类
    /// </summary>
    [SugarTable("Base_Channel")]
    public partial class ChannelEntity : BaseEntity
    {
        /// <summary>
        /// 渠道名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 省
        /// </summary>
        public int ProvinceId { get; set; }
        /// <summary>
        /// 市
        /// </summary>
        public int CityId { get; set; }
        /// <summary>
        /// 区
        /// </summary>
        public int AreaId { get; set; }
        /// <summary>
        /// 详细地址
        /// </summary>
        public string Address { get; set; }
        /// <summary>
        /// 备注说明
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedOn { get; set; } = DateTime.Now;
        /// <summary>
        /// 创建人
        /// </summary>
        public int? CreatedBy { get; set; }
        /// <summary>
        /// 编辑时间
        /// </summary>
        public DateTime? UpdatedOn { get; set; } = DateTime.Now;
        /// <summary>
        /// 编辑人
        /// </summary>
        public int? UpdatedBy { get; set; }
    }
    public partial class ChannelEntity
    {
        [Navigate(NavigateType.OneToMany, nameof(ChannelManagerEntity.ChannelId))]
        public List<ChannelManagerEntity> Managers { get; set; }//注意禁止给books手动赋值

        [Navigate(NavigateType.OneToOne, nameof(ProvinceId))]
        public Area Province { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(CityId))]
        public Area City { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(AreaId))]
        public Area Area { get; set; }
    }
}
